Video data in a digital format offers many advantages over the conventional analog format and has become the dominant format for video storage and transmission. The video data is usually digitized into an integer represented by a fixed number of bits, such as 8 bits or 10 bits per sample. Furthermore, color video data is often represented using a selected color system such as a Red-Green-Blue (RGB) primary color coordinates or a luminance-chrominance system. One of the popularly used luminance-chrominance color system used in digital video is the well-known YCrCb color system, where Y is referred to as the luminance component and Cr and Cb are referred to as the chrominance components. The RGB components and the Y component are associated with the intensity of the primary colors and the luminance respectively, and their digital representation is often mapped to an integer having a range associated with the number of bits of the digital representation. For example, an 8-bit video data usually represents an intensity level 0 to 255. On the other hand, the chrominance components, Cr and Cb, correspond to difference data and their digital representation is often mapped to an integer having negative and positive values. For example, an 8-bit Cr/Cb data represents a chrominance level from −128 to +127.
Along the processing path in a digital video system, the mean value of the processed video may be shifted which causes intensity offset. The intensity shifting may be caused by filtering, data rounding, quantization or other processing. Intensity shift, also called intensity offset, may cause visual impairment or artifacts, which is especially noticeable when the intensity shift varies from frame to frame. Therefore, the pixel intensity offset has to be carefully restored to avoid the potential problems mentioned above. However, picture contents often are very dynamic within a frame. In order to explore dynamic content characteristics within a picture, it is desirable to develop an apparatus and method for adaptive offset restoration that can be applied to a region of picture. Furthermore, it is desired to explore offset restoration adapted to pixel characteristics by classifying characteristics of an underlying pixel in the region into classes. Therefore, offset restoration can be performed adaptively for each class.